

from dexen.client.api import *


def getLoggingConfig(log_path):
    return {
        "version" : 1,
        "disable_existing_loggers" : False,
        "formatters" : {
            "simple" : {
                "format" : "[%(levelname)-5s] - %(asctime)s - %(name)-15s - " +
                           "%(message)s",
                "datefmt" : "%Y/%m/%d %H:%M:%S"
            }
        },
        "handlers" : {
            "console" : {
                "level" : "INFO",
                "class" : "logging.StreamHandler",
                "formatter" : "simple"
            },
            "file": {
                "level" : "DEBUG",
                "class" : "logging.FileHandler",
                "formatter" : "simple",
                "filename" : log_path,
                "mode" : "w"
            }
        },
        "loggers" : {
            __name__ : {
                "handlers" : ["console", "file"],
                "level" : "DEBUG",
            }
        }
    }

